﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace CNdotnet.Ezsocio.PluginFramework
{
    public class PlugInSettingCollection : List<PlugInSetting>
    {
        public PlugInSetting this[string key]
        {
            get
            {
                PlugInSetting setting = this.SingleOrDefault<PlugInSetting>(p => p.Name == key);
                if (setting == null)
                {
                    throw new Exception(String.Format("The key of {0} doesn't exist!",key));
                }

                return setting;
            }
        }
    }
}
